﻿using System;

namespace Wala.Common
{
    public class Ultility
    {
        public static uint GetTotalSeconds(DateTime dateTime)
        {
            uint totalSecond = 0;
            DateTime time = new DateTime(1970, 1, 1, 7, 0, 0);
            TimeSpan timeSpan = dateTime - time;
            totalSecond =Convert.ToUInt32(timeSpan.TotalSeconds);
            return totalSecond;
        }

        public static DateTime ToDateTime(uint seconds)
        {
            DateTime time = new DateTime(1970, 1, 1, 7, 0, 0);

            time = time.AddSeconds(seconds);
            return time;
        }
    }
}
